package com.du.integration.server.config;

import com.du.integration.server.handle.MqttMsgHandle;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.List;

/**
 * @Desc :
 * @Author: shuangdu
 * @date : 2024/1/4
 */
@Configuration
@ConfigurationProperties(prefix = "mqtt")
@Getter
@Setter
public class MqttOption {

    private String host;

    private String username;

    private String password;

    private String clientId;

    private Integer timeout;

    private Integer keepAlive;

    private Boolean clearSession;

    private Topic<MqttMsgHandle>[] topics;

    @Getter
    @Setter
    public static class Topic<T> {
        private String name;
        private Class<T> handle;
    }
}
